/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package heartsclient;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author quangduc
 */
public class QuanBai extends JLabel {

    int number;
    int type;
    int layer;
    String path;
    boolean isUse = false;

    public QuanBai(int num, int _type) {
        number = num;
        type = _type;
        path = System.getProperty("user.dir") + "\\src\\card\\" + Integer.toString(number+2) + "_"
                + Integer.toString(_type+1) + ".gif";
        ImageIcon bgCard = new ImageIcon(path);
        this.setIcon(bgCard);
        this.setBounds(0, 0, bgCard.getIconWidth(), bgCard.getIconHeight());
    }

    public QuanBai(int num, int _type, int _layer) {
        layer = _layer;
        number = num;
        type = _type;
        path = System.getProperty("user.dir") + "\\src\\card\\" + Integer.toString(number+2) + "_"
                + Integer.toString(_type+1) + ".gif";
        ImageIcon bgCard = new ImageIcon(path);
        this.setIcon(bgCard);
        this.setBounds(0, 0, bgCard.getIconWidth(), bgCard.getIconHeight());
    }

    public void set(QuanBai card) {
        this.number = card.number;
        this.path = card.path;
        this.layer = card.layer;
    }

    public String GetSourcePath() {
        return this.path;
    }

    public boolean isLower(QuanBai card) {
        if (this.type < card.type) {
            return true;
        }
        if (this.type == card.type) {
            if (this.number < card.number) {
                return true;
            }
        }
        return false;
    }
}
